/*
 * Name: DB.h
 *
 * Created on: May 3, 2011
 * Author: Siddhi Mittal
 * Description: Header class for the Wrapper DB
 */

#ifndef __DB_H__
#define __DB_H__
#include "Database.h"
#include <string.h>
#include <stdio.h>

class DB {
private:
	Database *db;
public:
	DB(); //Constructor
	void createTable(); //Creates the table
	void insertURL(char* url,  char* category, int counterUp = 0, int counterDown = 0); //Insert a URL and Up and Down counter, category
	vector<vector<string> > getURLs(char* url); //Returns all the URLs
	void incCounter(char* url); // Increases the counter of the given URL by 1
	void decCounter(char* url); //Dncreases the counter of teh given URL by 1
	int getCounterUp (char* url); //Returns the + counter for a given URL
	int getCounterDown (char* url); //Returns the - counter for a given URL
	char* getCategory(char* url); //Returns the category of the given URL
	void addComment(char* url, char* comment); //Adds a comment to the specific URL
	void printValues(vector<vector<string> > result); //Test print
	vector<vector<string> > getComments(char* url); //returns all the comments of the specific URL
	void closeDB(); //closes the connection to the DB
	~DB(); //Deconstructor
};

#endif


